# Base image for HDS client
FROM        centos:latest
MAINTAINER  Andy Zhang <leowa@outlook.com>
ENV         container=docker
ENV         INST_DIR /var/setup
RUN         mkdir $INST_DIR
WORKDIR     $INST_DIR
COPY        req.txt req.txt
ENV         INFORMIXDIR /opt/informix/
ENV         INFORMIXSERVER local_ifx
ENV         LD_LIBRARY_PATH /usr/lib64/:/usr/lib:/usr/libexec/:$INFORMIXDIR/lib/esql:$INFORMIXDIR/lib/
ADD         http://localhost:8080/clientsdk.4.10.FC6DE.LINUX.tar clientsdk.tar
ADD         https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm  epel-release-latest-7.noarch.rpm
RUN         mkdir clientsdk && tar -xvf clientsdk.tar -C clientsdk && cd clientsdk \
            && ./installclientsdk -i silent -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR=$INFORMIXDIR
RUN         rpm -Uvh epel-release-latest-7.noarch.rpm && yum update -y && yum install -y python-pip python-devel gcc
RUN         pip install -r req.txt  -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
WORKDIR     $INFORMIXDIR
COPY        sqlhosts.ifxserver $INFORMIXDIR/etc/
ENV         INFORMIXSQLHOSTS $INFORMIXDIR/etc/sqlhosts.ifxserver
RUN         rm -fr $INST_DIR
